import axios from 'axios'
import url from './url'

// 封装 GET 方法
export const get = (url) => {
  return axios.get(url)
}

// 封装 POST 方法
export const postConfiguration = (data) => {
  return axios.post(url.postConfiguration, data)
}

// 封装 POST 方法
export const postTrees = (data) => {
  return axios.post(url.postTrees, data)
}


export const getDeviceList = () => {
  return axios.get(url.deviceList)
}


export const postOpenVideUrl = (data) => {
  return axios.post(url.postOpenChannelsPlayUrl, data)
}

// 监测点点位信息
export const deviceMap = (data) => {
  return axios.post(url.deviceMap, data);
};

// 监测点详情信息
export const devCodeXq = (data) => {
  return axios.post(url.devCode, data)
}

// 监测点瞬时数据
export const singleDataSs = (data) => {
  return axios.post(url.singleData, data)
}
/**
 * 值班管理
 */
export const getListData = (data) => {
  return axios.get(url.getListData, data)
}

export const getByIdData = (data) => {
  return axios.post(url.getByIdData, data)
}
// 数据总览+各水厂昨日供水量及占比
// export const getOverview = (data) => {
//   return axios.get(url.Overview, data)
// }
export const getOverview = url.Overview

// 管网，水厂点位数据
export const advancedAllList = (data) => {
  return axios.post(url.advancedAllList, data)
}

// 水厂日/月供水量/水库弹窗展示信息
export const dataFactoryFn = (data) => {
  return axios.post(url.datafactory, data)
}

// 今日取水/小时
export const waterIntakingFn = (data) => {
  return axios.post(url.waterIntaking, data)
}

// 报警分析统计
export const PostStatistics = (data) => {
  return axios.post(url.statistics, data)
}

// 评估分析、方案管理表
export const PlanTableList = (data) => {
  return axios.post(url.PlanTableList, data)
}

// 评估分析、控制点限制管理表
export const DyCpLimit = (data) => {
  return axios.post(url.DyCpLimit, data)
}

// 评估分析、评估分析树图数据
export const DyCpAllManageTree = (data) => {
  return axios.put(url.DyCpAllManageTree, data)
}

// 评估分析站点名称列表数据
export const DyCpAllManageTable = (data) => {
  return axios.post(url.DyCpAllManageTable, data)
}
// 4
// 评估分析方案管理增删改查接口
export const DyprojectManageEdit = (data) => {
  return axios.put(url.DyprojectManageEdit, data)
}

// 2



// 1
// 评估分析方案管理生成id
export const DypostTable = (data) => {
  return axios.post(url.DypostTable, data)
}
// export const Dyexpressions = (id) => {
//   // return axios.patch (url.DyprojectManageEdit, data)

//   return axios.get(`${url.Dyexpressions}?version=${id}`, {}, {

//   });
// }



// 评估分析方案id回显
export const DyprojectManageID = (id) => {
  // 拼接路径和参数
  return axios.put(`${url.DyprojectManageID}/${id}`, {}, {
    headers: {
      'Content-Type': 'application/json' // 或者根据服务器的要求调整
    }
  });
}
// 评估分析方案管理表查询接口
export const DyTableQuery = (data) => {
  return axios.post(url.DyTableQuery, data)
}

// 评估分析方案管理表删除接口
export const DyTableDelete = (id) => {
  return axios.put(`${url.DyTableDelete}/${id}`, {}, {
    headers: {
      'Content-Type': 'application/json' // 或者根据服务器的要求调整
    }
  });
}

// 分区供水接口-和达

export const PostUserAuth = (data) => {
  return axios.post(url.userAuth, data)
}

export const PostGisInfo = (data) => {
  return axios.post(url.gisInfo, data)
}

export const PostFqsQuery = (data) => {
  return axios.post(url.fqsQuery, data)
}


// 分区供水接口-92测试

export const PostGetToken = () => {
  return axios.post(url.getToken)
}

export const PostGetSubzoneMessage = () => {
  return axios.post(url.getSubzoneMessage)
}

export const PostGetSubzoneData = () => {
  return axios.post(url.getSubzoneData)
}

//报警记录
export const AlarmRecord = (data) => {
  return axios.post(url.AlarmRecord, data)
}

//热力图
export const DyWarningStabyHour = (data) => {
  return axios.post(url.DyWarningStabyHour, data)
}





// 历史监测数据查询接口
export const PostMonitorhistory = (data) => {
  return axios.post(url.monitorhistory, data)
}

//新 新增方法
export const postaddTable = (data) => {
  return axios.post(url.addTable, data)
}

//树图站点名称
export const postthreesiteName = (data) => {
  return axios.post(url.threesiteName, data)
}


//控制点限制管理编辑
export const putpointEdit = (data) => {
  return axios.put(url.pointEdit, data)
}

//控制点限制管理新增
export const postaddSiteLimit = (data) => {
  return axios.post(url.addSiteLimit, data)
}


//方案管理树回显
export const postaddSiteupdate = (data) => {
  return axios.post(url.addSiteupdate, data)
}



//控制点限制管理删除
export const putdelettable2 = (id) => {
  return axios.put(`${url.delettable2}/${id}`, {}, {
    headers: {
      'Content-Type': 'application/json' // 或者根据服务器的要求调整
    }
  });
}

//控制点限制管理编辑回显

export const puteditTable2 = (id) => {
  // 拼接路径和参数
  return axios.put(`${url.editTable2}/${id}`, {}, {
    headers: {
      'Content-Type': 'application/json' // 或者根据服务器的要求调整
    }
  });
}

//控制点限制管理编辑列表回显

export const postgetSiteLimit = (data) => {
  return axios.post(url.getSiteLimit, data)
}


///控制点新增修改接口
export const postupdateSiteLimit = (data) => {
  return axios.post(url.updateSiteLimit, data)
}

//方案列表排序
export const postprojectManageOrder = (data) => {
  return axios.post(url.projectManageOrder, data)
}
//方案管理编辑接口

export const postupdateAllManage = (data) => {
  return axios.post(url.updateAllManage, data)
}

